#ifndef __FILEHANDLER_H__
#define __FILEHANDLER_H__

#include <fstream>
#include <iostream>

extern int DEBUG;

#ifndef __FILE_DEF__
#define __FILE_DEF__
enum openmode{
        FILE_IN = 0x01,
        FILE_OUT = 0x02,
        FILE_APPEND = 0x04,
        FILE_TRUNCATE = 0x08
    };
#endif

using namespace std;

class file {
    public:
        file();         //constructor
        ~file();        //destructor
        int mode;       //mode

        bool eof;

        int open();
        void close();
        void set(string& strName);
        int getchar();
        int putchar(char c);
        int putstr(char* str);
        bool state();

        fstream filestr;
    private:
        char c;
        string fileName;
};

#endif // __FILEHANDLER_H__
